<template>
	<el-table
	  :data="tabledata"
      style="width: 100%">
      <template  v-for="item,index in config">
	      <el-table-column 
	        :prop="item.field"
	        :label="item.label"
	        :width="item.labelWidth">
	        <template slot-scope="scope">
	            <template v-if="item.type == 'image'">
	                <div class="__table_img" :style="`background-image: url(${scope.row[item.field]})`">
	                </div>
	            </template>
	            <template v-else>
	                {{scope.row[item.field]}}
	            </template>
	        </template>
	      </el-table-column>
      </template>
    </el-table>
</template>
<script type="text/javascript">
	export default {
		data(){
			return {

			}
		},
		props:{
			value:[Array,Object],
			config:[Array,Object]
		},
		computed:{
			tabledata:function(){
				var arr = [];
				arr.push(this.value);
				return arr;
			}

		},
		mounted(){
			console.log('启用');
			console.log('配置',this.config);
			console.log('数据',this.tabledata);
			for(var item in this.config){
				console.log('item',item);
			}
		}
	}
</script>
<style type="text/css" lang="scss">
	
</style>